<template>
	<view class="index_box">
		<view class="tip-text" v-if="!token">
			当前显示的订单为随机推送订单，需登录后完善个人信息，才能查看符合您的订单。
		</view>
		<view class="" style="background-color: #fff;" v-else>
			<mytabs style="width: 100%;" :items="list" @selected="onTabSelected"></mytabs>
		</view>
		<block>
			<orderCard :current="current"></orderCard>
		</block>

	</view>
</template>

<script>
	import {
		comprehensive,
		orderListIndex
	} from '@/common/teacherReq';
	import orderCard from '@/components/ordercard.vue';
	import mytabs from '@/components/mytabs.vue';
	export default {
		components: {
			orderCard,
			mytabs
		},
		data() {
			return {
				keyword: '',
				current: 0,
				list: [{
						name: '综合订单',
						index: 0
					},
					{
						name: '附近订单',
						index: 1

					},
					{
						name: '报价订单',
						index: 2
					},
					{
						name: '指派订单',
						index: 3
					}
				],
				token: ''
			}
		},
		methods: {
			to(url) {
				uni.navigateTo({
					url: url
				})
			},
			onTabSelected(item) {
				this.current = item.index;
			},
			
		},
		onLoad(opt) {
			// console.log('opt: ', uni.getStorageSync('login'));
			let isLogin = uni.getStorageSync('login')
			if (!isLogin) {
				// uni.redirectTo({
				// 	url:'/subpack/login/login'
				// })
			}
		},
		onShow() {
			this.token = uni.getStorageSync('token')
			console.log(this.token,'-----token')
		},
		computed: {

		},
	}
</script>

<style scoped lang="scss">
	.tip-text {
		padding: 20rpx;
		background-color: #F7FCE6;
		font-size: 24rpx;
		color: #808764;
	}

	.index_box {
		height: 100vh;
		overflow: hidden;
	}
</style>